home *** CD-ROM | disk | FTP | other *** search
/ EnigmA Amiga Run 1995 October / EnigmA AMIGA RUN 01 (1995)(G.R. Edizioni)(IT)[!][issue 1995-10][Aminet 7].iso / Aminet / comm / cnet / dmitop10.lha / DmiTop.REXX < prev    next >
OS/2 REXX Batch file  |  1994-06-20  |  8KB  |  256 lines

  1. /*****************
  2.  *  DMITop v1.0a *
  3.  *      by       * 
  4.  * Wolverine/DMI *
  5.  *  (C)1994 DMI  *
  6.  *****************/
  7.  
  8. options results
  9. bufferflush
  10.  
  11. signal on error;signal on ioerr;signal on syntax
  12.  
  13. changewhere 'DMITop...';BBSIDENTIFY Name;bbsname=result
  14. tr='transmit';ss='sendstring';ls='loadscratch';gs='getscratch'
  15. gu='getuser'
  16. gu 12;date=result
  17. file1='ram:mess';file2='ram:filup';file3='ram:kbup';file4='ram:calls'
  18. file5='ram:fildn';file6='ram:kbdn'
  19. ffile1='ram:smess';ffile2='ram:sfilup';ffile3='ram:skbup';ffile4='ram:scalls'
  20. ffile5='ram:sfildn';ffile6='ram:skbdn';sort='C:QSort';Sopt='DESCEND'
  21. del='c:delete'
  22. startacc=2
  23. endacc=100
  24.  
  25. CLS
  26. tr ''
  27. tr center('c7z4DMITop v1.0a (C) 1994 by Wolverine / DMIc3z0',91)
  28. tr ''
  29. tr center('c6Reading accounts.....',82)
  30. call open(fil1,file1,'W')
  31. call open(fil2,file2,'W')
  32. call open(fil3,file3,'W')
  33. call open(fil4,file4,'W')
  34. call open(fil5,file5,'W')
  35. call open(fil6,file6,'W')
  36.  
  37. do i=startacc to endacc
  38. ls i;succ=result
  39. if succ=1 then do
  40. gs 1;handle=result
  41. gs 22;ncall=result
  42. gs 30;upkb=result
  43. gs 31;filup=result
  44. gs 32;dnkb=result
  45. gs 33;fildn=result
  46. gs 36;pubmess=result
  47. call writeln(fil1,right(pubmess,10)' 'left(handle,30))
  48. call writeln(fil2,right(filup,10)' 'left(handle,30))
  49. call writeln(fil3,right(upkb,10)' 'left(handle,30))
  50. call writeln(fil4,right(ncall,10)' 'left(handle,30))
  51. call writeln(fil5,right(fildn,10)' 'left(handle,30))
  52. call writeln(fil6,right(dnkb,10)' 'left(handle,30))
  53. end
  54. end
  55.  
  56. FinAcc:
  57. call close(fil1)
  58. call close(fil2)
  59. call close(fil3)
  60. call close(fil4)
  61. call close(fil5)
  62. call close(fil6)
  63.  
  64. tr center('Sorting......',79)
  65.  
  66.  address command sort' 'file1' 'ffile1' 'sopt
  67.  address command sort' 'file2' 'ffile2' 'sopt
  68.  address command sort' 'file3' 'ffile3' 'sopt
  69.  address command sort' 'file4' 'ffile4' 'sopt
  70.  address command sort' 'file5' 'ffile5' 'sopt
  71.  address command sort' 'file6' 'ffile6' 'sopt
  72.  
  73. tr center('Sorting complete....Writing data...',79)
  74. call open(fil1,ffile1,'r')
  75. call open(fil2,'GFILES:DMITop/DMITop.Mess','w')
  76. call writeln(fil2,'f1')
  77. call writeln(fil2,center('c6Top Ten Message Writers at c7'bbsname'c6 .Generated with c1DMITopc6.',94))
  78. call writeln(fil2,center('Updated on  c7'date'c6.',88))
  79. call writeln(fil2,' ')
  80. call writeln(fil2,center('c7 #c5  :c7  Namec5             :c7    Msgsc5   :',97))
  81. call writeln(fil2,center('-------------------------------------',79))
  82. L=1
  83. MCont:
  84. line=readln(fil1);nmess=word(line,1);handle=substr(line,12,20)
  85. lline='c2'l'c3 'right(handle,23)'c1 'right(nmess,9)
  86. call writeln(fil2,right(lline,66))
  87. if ~eof(fil2) then do
  88. l = l + 1
  89. if l=11 then signal FUWrt
  90. end
  91. signal Mcont
  92. end
  93.  
  94. FUWRT:
  95. call writeln(fil2,center('c5-------------------------------------',82))
  96. call writeln(fil2,' ')
  97. call writeln(fil2,center('c7z4 DMITop (C)1994 by Wolverine / DMIc3z0 ',91))
  98. call close(fil1);call close(fil2)
  99. call open(fil1,ffile2,'r')
  100. call open(fil2,'GFILES:DMITop/DMITop.FilUp','w')
  101. call writeln(fil2,'f1')
  102. call writeln(fil2,center('c6Top Ten Uploaders in files at c7'bbsname'c6 .Generated with c1DMITopc6.',94))
  103. call writeln(fil2,center('Updated on  c7'date'c6.',88))
  104. call writeln(fil2,' ')
  105. call writeln(fil2,center('c7 #c5  :c7  Namec5             :c7   Filesc5   :',97))
  106. call writeln(fil2,center('-------------------------------------',79))
  107. L=1
  108. FUCont:
  109. line=readln(fil1);nmess=word(line,1);handle=substr(line,12,20)
  110. lline='c2'l'c3 'right(handle,23)'c1 'right(nmess,9)
  111. call writeln(fil2,right(lline,66))
  112. if ~eof(fil2) then do
  113. l = l + 1
  114. if l=11 then signal KBUWrt
  115. end
  116. signal FUcont
  117. end
  118.  
  119. KBUWRT:
  120. call writeln(fil2,center('c5-------------------------------------',82))
  121. call writeln(fil2,' ')
  122. call writeln(fil2,center('c7z4 DMITop (C)1994 by Wolverine / DMIc3z0 ',91))
  123. call close(fil1);call close(fil2)
  124. call open(fil1,ffile3,'r')
  125. call open(fil2,'GFILES:DMITop/DMITop.KBUp','w')
  126. call writeln(fil2,'f1')
  127. call writeln(fil2,center('c6Top Ten Uploaders in Kbytes at c7'bbsname'c6 .Generated with c1DMITopc6.',94))
  128. call writeln(fil2,center('Updated on  c7'date'c6.',88))
  129. call writeln(fil2,' ')
  130. call writeln(fil2,center('c7 #c5  :c7  Namec5             :c7     KBc5    :',97))
  131. call writeln(fil2,center('-------------------------------------',79))
  132. L=1
  133. KBUCont:
  134. line=readln(fil1);nmess=word(line,1);handle=substr(line,12,20)
  135. lline='c2'l'c3 'right(handle,23)'c1 'right(nmess,9)
  136. call writeln(fil2,right(lline,66))
  137. if ~eof(fil2) then do
  138. l = l + 1
  139. if l=11 then signal CallWrt
  140. end
  141. signal KBUcont
  142. end
  143.  
  144. CallWRT:
  145. call writeln(fil2,center('c5-------------------------------------',82))
  146. call writeln(fil2,' ')
  147. call writeln(fil2,center('c7z4 DMITop (C)1994 by Wolverine / DMIc3z0 ',91))
  148. call close(fil1);call close(fil2)
  149. call open(fil1,ffile4,'r')
  150. call open(fil2,'GFILES:DMITop/DMITop.calls','w')
  151. call writeln(fil2,'f1')
  152. call writeln(fil2,center('c6Top Ten Callers at c7'bbsname'c6 .Generated with c1DMITopc6.',94))
  153. call writeln(fil2,center('Updated on  c7'date'c6.',88))
  154. call writeln(fil2,' ')
  155. call writeln(fil2,center('c7 #c5  :c7  Namec5             :c7   Callsc5   :',97))
  156. call writeln(fil2,center('-------------------------------------',79))
  157. L=1
  158. CallCont:
  159. line=readln(fil1);nmess=word(line,1);handle=substr(line,12,20)
  160. lline='c2'l'c3 'right(handle,23)'c1 'right(nmess,9)
  161. call writeln(fil2,right(lline,66))
  162. if ~eof(fil2) then do
  163. l = l + 1
  164. if l=11 then signal FdnWrt
  165. end
  166. signal Callcont
  167. end
  168.  
  169. FDNWrt:
  170. call writeln(fil2,center('c5-------------------------------------',82))
  171. call writeln(fil2,' ')
  172. call writeln(fil2,center('c7z4 DMITop (C)1994 by Wolverine / DMIc3z0 ',91))
  173. call close(fil1);call close(fil2)
  174. call open(fil1,ffile5,'r')
  175. call open(fil2,'GFILES:DMITop/DMITop.FilDN','w')
  176. call writeln(fil2,'f1')
  177. call writeln(fil2,center('c6Top Ten Downloaders in files at c7'bbsname'c6 .Generated with c1DMITopc6.',94))
  178. call writeln(fil2,center('Updated on  c7'date'c6.',88))
  179. call writeln(fil2,' ')
  180. call writeln(fil2,center('c7 #c5  :c7  Namec5             :c7   Filesc5   :',97))
  181. call writeln(fil2,center('-------------------------------------',79))
  182. L=1
  183. FDNCont:
  184. line=readln(fil1);nmess=word(line,1);handle=substr(line,12,20)
  185. lline='c2'l'c3 'right(handle,23)'c1 'right(nmess,9)
  186. call writeln(fil2,right(lline,66))
  187. if ~eof(fil2) then do
  188. l = l + 1
  189. if l=11 then signal KBdnWrt
  190. end
  191. signal FDNcont
  192. end
  193.  
  194. KBdnWRT:
  195. call writeln(fil2,center('c5-------------------------------------',82))
  196. call writeln(fil2,' ')
  197. call writeln(fil2,center('c7z4 DMITop (C)1994 by Wolverine / DMIc3z0 ',91))
  198. call close(fil1);call close(fil2)
  199. call open(fil1,ffile6,'r')
  200. call open(fil2,'GFILES:DMITop/DMITop.KBdn','w')
  201. call writeln(fil2,'f1')
  202. call writeln(fil2,center('c6Top Ten Downloaders in Kbytes at c7'bbsname'c6 .Generated with c1DMITopc6.',94))
  203. call writeln(fil2,center('Updated on  c7'date'c6.',88))
  204. call writeln(fil2,' ')
  205. call writeln(fil2,center('c7 #c5  :c7  Namec5             :c7     KB  c5  :',97))
  206. call writeln(fil2,center('-------------------------------------',79))
  207. L=1
  208. KBdnCont:
  209. line=readln(fil1);nmess=word(line,1);handle=substr(line,12,20)
  210. lline='c2'l'c3 'right(handle,23)'c1 'right(nmess,9)
  211. call writeln(fil2,right(lline,66))
  212. if ~eof(fil2) then do
  213. l = l + 1
  214. if l=11 then signal Through
  215. end
  216. signal KBdncont
  217. end
  218.  
  219. Through:
  220. call writeln(fil2,center('c5-------------------------------------',82))
  221. call writeln(fil2,' ')
  222. call writeln(fil2,center('c7z4 DMITop (C)1994 by Wolverine / DMIc3z0 ',91))
  223. call close(fil1);call close(fil2)
  224. logentry ' c2Used c1DMITopc2 to generate TopUser-lists...'
  225. tr center('Deleting temporary files.....c3',82)
  226. tr ''
  227. address command del' 'file1
  228. address command del' 'file2
  229. address command del' 'file3
  230. address command del' 'file4
  231. address command del' 'file5
  232. address command del' 'file6
  233. address command del' 'ffile1
  234. address command del' 'ffile2
  235. address command del' 'ffile3
  236. address command del' 'ffile4
  237. address command del' 'ffile5
  238. address command del' 'ffile6
  239. tr center('c2All done...The data-files containing TopUser-data will be',82)
  240. tr center('in the c1DMITopc2 drawer in your c1GFILES:c2 directory....',91)
  241. tr''
  242. tr center('c7Thank you for using c1DMITopc7.....',88)
  243. exit
  244.  
  245. ERROR:
  246. tr " An Error"
  247. exit
  248.  
  249. SYNTAX:
  250. tr "A Syntax Error"
  251. exit
  252.  
  253. IOERR:
  254. tr " An I/O error"
  255. exit
  256.